# --- T2-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# 
# T2 SDE: package/.../gpart/largefile.patch
# Copyright (C) 2006 The T2 SDE Project
# 
# More information can be found in the files COPYING and README.
# 
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- T2-COPYRIGHT-NOTE-END ---

diff -ur gpart-0.1h/src/gpart.c gpart-0.1h-fixed/src/gpart.c
--- gpart-0.1h/src/gpart.c	2001-02-07 19:08:08.000000000 +0100
+++ gpart-0.1h-fixed/src/gpart.c	2006-08-14 09:24:51.000000000 +0200
@@ -45,6 +45,7 @@
  *
  */
 
+#include "gpart.h"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -56,7 +57,6 @@
 #include <errno.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-#include "gpart.h"
 
 
 static const char	rcsid[] = "$Id: gpart.c,v 1.11 2001/02/07 18:08:08 mb Exp mb $";
diff -ur gpart-0.1h/src/l64seek.c gpart-0.1h-fixed/src/l64seek.c
--- gpart-0.1h/src/l64seek.c	2006-08-14 09:38:59.000000000 +0200
+++ gpart-0.1h-fixed/src/l64seek.c	2006-08-14 09:30:11.000000000 +0200
@@ -26,36 +26,6 @@
 } ostck[OSTACKLEN];
 static int		osptr = -1;
 
-#if defined(__linux__) && defined(__i386__)
-_syscall5(int,_llseek,uint,fd,ulong,hi,ulong,lo,loff_t *,res,uint,wh)
-#endif
-
-
-
-off64_t l64seek(int fd,off64_t offset,int whence)
-{
-	off64_t		ret = (off64_t)-1;
-
-#if defined(__linux__) && defined(__i386__)
-	int		iret;
-	unsigned long	ohi, olo;
-
-	ohi = (unsigned long)((offset >> 32) & 0xFFFFFFFF);
-	olo = (unsigned long)(offset & 0xFFFFFFFF);
-	iret = _llseek(fd,ohi,olo,&ret,whence);
-	if (iret == -1)
-		ret = (off64_t)-1;
-#endif
-
-#if defined(__FreeBSD__) || (defined(__linux__) && defined(__alpha__))
-	ret = lseek(fd,offset,whence);
-#endif
-
-	return (ret);
-}
-
-
-
 int l64opush(int fd)
 {
 	s64_t		fpos;
diff -ur gpart-0.1h/src/l64seek.h gpart-0.1h-fixed/src/l64seek.h
--- gpart-0.1h/src/l64seek.h	2000-12-13 23:56:07.000000000 +0100
+++ gpart-0.1h-fixed/src/l64seek.h	2006-08-14 09:26:06.000000000 +0200
@@ -17,31 +17,21 @@
 #ifndef _L64SEEK_H
 #define _L64SEEK_H
 
-#include <unistd.h>
-
-/*
- * define a type 'off64_t' which is at least 64bit, and a
- * lseek function capable of seeking with at least 64bit
- * offsets.
- */
-
-
-#if defined(__linux__)
-#	include <linux/unistd.h>
-#	include <sys/types.h>
-	typedef int64_t off64_t;
-#endif
+#define _FILE_OFFSET_BITS 64
+#define __USE_LARGEFILE64
+#define __USE_FILE_OFFSET64
 
+#include <unistd.h>
 
-#if defined(__FreeBSD__)
-	typedef off_t off64_t;
-#endif
-
+#include <sys/types.h>
 
+typedef off_t off64_t;
 typedef off64_t s64_t;
 
-off64_t l64seek(int fd, off64_t offset, int whence);
+
 #define l64tell(fd) l64seek(fd,0,SEEK_CUR)
+#define l64seek lseek
+
 int l64opush(int);
 s64_t l64opop(int);
 
--- gpart-0.1h/src/l64seek.h	2006-10-04 17:31:31.000000000 +0000
+++ gpart-0.1h-fixed/src/l64seek.h	2006-10-04 17:32:39.000000000 +0000
@@ -25,9 +25,7 @@
 
 #include <sys/types.h>
 
-typedef off_t off64_t;
-typedef off64_t s64_t;
-
+typedef off_t s64_t;
 
 #define l64tell(fd) l64seek(fd,0,SEEK_CUR)
 #define l64seek lseek
